package chat.whiteboard.components.legend;

import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

import chat.whiteboard.models.UserModel;

public class LegendListCellRenderer extends JLabel implements ListCellRenderer<UserModel> {

	@Override
	public Component getListCellRendererComponent(
			JList<? extends UserModel> list, UserModel value, int index,
			boolean isSelected, boolean cellHasFocus) {
		setOpaque(true);
		setText(value.get_text());
		setBackground(value.get_color());
		return this;
	}
}
